package work.mediway.mdm.core.mapper;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;
import java.util.Map;

/**
 * @author zhongyj <1126834403@qq.com><br/>
 * @date 2022/4/2
 */
@Mapper
public interface CommonMapper {

    /**
     * 根据传入SQL查询
     *
     * @param sqlStr String
     * @return List<Map < String, Object>>
     */
    @Select("${sqlStr}")
    List<Map<String, Object>> getPublicItems(@Param(value = "sqlStr") String sqlStr);

    /**
     * 执行SQL
     *
     * @param sqlStr String
     * @return int
     */
    @Insert("${sqlStr}")
    int saveItems(@Param(value = "sqlStr") String sqlStr);

    /**
     * 执行SQL
     *
     * @param sqlStr String
     * @return int
     */
    @Update("${sqlStr}")
    int updateItems(@Param(value = "sqlStr") String sqlStr);
}

